<?php 
$opts = new stdClass();
$opts->cd = 't.parent_id = :v1';
$opts->cdv = array(':v1' => 0);
$ft_cats = $orm->get('pb_ht_category', 't.visited__', 'DESC', 1, 4, $opts)->d;
foreach ($ft_cats as $itm) {
  $opts = new stdClass();
  $opts->cd = 't.categories__ LIKE :v1';
  $opts->cdv = array(':v1' => '%,' . $itm->id . ',%');
  $itm->__posts = $orm->get('pb_ht_article', 't.visited__', 'DESC', 1, 6, $opts)->d;
}
?>

<style>
table.help {
  width: 950px;
  margin: 0 auto;
  color: #fff;
}
table.help * {
  font-size: 12px;
}
table.help td {
  vertical-align: top;
  text-align: left;
}
table.help td.main {
  width: 15%;
}
table.help a {
  font-family: Lucida Sans Unicode !important;
  color: #fff;
}
table.help div {
  font-family: Lucida Sans Unicode !important;
  font-weight: bold;
}
table.help ul {
  padding: 0;
  margin: 0;
  margin-left: 10px;
  margin-top: 5px;
  list-style-type: none;
}
table.help li {
  margin: 0;
  padding: 3px 0;
}
table.help img {
  height: 120px;
}
</style>
<div>&nbsp;</div>
<table class="help" cellpadding=0 cellspacing=0>
  <tr>
    <td class="main" style="text-align: center;">
      <div>Pozo安全认证</div>
      <img src="<?php echo TH_DIR . basename(dirname(__FILE__)); ?>/skin/images/secure.png"></img>
    </td>
    <td style="padding: 0 10px;"><img src="<?php echo TH_DIR . basename(dirname(__FILE__)); ?>/skin/images/line.jpg"></img></td>
    <td class="main">
      <div>网站内容</div>
      <ul>
        <?php foreach ($app_data->pages as $itm) { ?>
          <?php if ($itm->parent_id == 0 && $itm->is_visible == 1) { ?>
          <li><a href="#" onclick="return Url.redirect(____redmd, ____sys + '.php?i=<?php echo $itm->id; ?>');"><?php echo $itm->name; ?></a></li>
          <?php }?>
        <?php } ?>
      </ul>
    </td>
    <td style="padding: 0 10px;"><img src="<?php echo TH_DIR . basename(dirname(__FILE__)); ?>/skin/images/line.jpg" alt=""></img></td>
    <?php foreach ($ft_cats as $idx => $itm) { ?>
      <td class="main">
        <div><a href="#" onclick="return Url.redirect(____redmd, ____sys + '.php?i=<?php echo ART_ID; ?>&cat=<?php echo $itm->id; ?>');""><?php echo $itm->name; ?></a></div>
        <ul>
          <?php foreach ($itm->__posts as $itm2) { ?>
            <li title="<?php echo Utils::get_short($itm2->column__ . ' ' . $itm2->title, 1000); ?>"><a href="#" onclick="return Url.redirect(____redmd, ____sys + '.php?i=<?php echo ART_ID; ?>&__file=index_article&id=<?php echo $itm2->id; ?>');""><?php echo Utils::get_short($itm2->column__ . ' ' . $itm2->title, 10); ?></a></li>
          <?php } ?>
        </ul>
      </td>
      <?php if ($idx < (count($ft_cats) - 1)) { ?>
      <td style="padding: 0 10px;"><img src="<?php echo TH_DIR . basename(dirname(__FILE__)); ?>/skin/images/line.jpg" alt=""></img></td>
      <?php } ?>
    <?php } ?>
  </tr>
</table>
